package kr.co.doriclassic.pro21;

/*public class Test {
	public static void main(String[] args) {
		
		try {
			sub();
		} catch (Exception e) {
			System.out.println("범위 초과");
		}
	}
	
	public static void sub() throws ArrayIndexOutOfBoundsException{
		int[] array=new int[10];
		int i = array[10];
	}
}*/
public class Test {
	public static void main(String[] args) {
		
			sub();
	}
	
	public static void sub(){
		int[] array=new int[10];
		try {
			int i = array[10];
		} catch (Exception e) {
			System.out.println("범위 초과");
		}

	}
}
